/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package podologia.beansDB;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Hernan
 */
@Entity
@Table(name = "lugaratencion")
@NamedQueries({@NamedQuery(name = "Lugaratencion.findByIdLugar", query = "SELECT l FROM Lugaratencion l WHERE l.idLugar = :idLugar"), @NamedQuery(name = "Lugaratencion.findByLugar", query = "SELECT l FROM Lugaratencion l WHERE l.lugar = :lugar"), @NamedQuery(name = "Lugaratencion.findByObservaciones", query = "SELECT l FROM Lugaratencion l WHERE l.observaciones = :observaciones")})
public class Lugaratencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    @Column(name = "idLugar", nullable = false)
    private Integer idLugar;
    @Column(name = "lugar")
    private String lugar;
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(mappedBy = "idLugarAte")
    private Collection<Turno> turnoCollection;

    public Lugaratencion() {
    }

    public Lugaratencion(Integer idLugar) {
        this.idLugar = idLugar;
    }

    public Integer getIdLugar() {
        return idLugar;
    }

    public void setIdLugar(Integer idLugar) {
        this.idLugar = idLugar;
    }

    public String getLugar() {
        return lugar;
    }

    public void setLugar(String lugar) {
        this.lugar = lugar;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Collection<Turno> getTurnoCollection() {
        return turnoCollection;
    }

    public void setTurnoCollection(Collection<Turno> turnoCollection) {
        this.turnoCollection = turnoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLugar != null ? idLugar.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Lugaratencion)) {
            return false;
        }
        Lugaratencion other = (Lugaratencion) object;
        if ((this.idLugar == null && other.idLugar != null) || (this.idLugar != null && !this.idLugar.equals(other.idLugar))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "podologia.beansDB.Lugaratencion[idLugar=" + idLugar + "]";
    }

}
